package com.cloudxingkong.dianyinke.Student.Adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * 云星空科技
 * Created by ningfei on 2016/3/17.
 * 课程约课Adapter
 */
public class CourseBookingAdapter extends FragmentPagerAdapter {
    private List<Fragment> fragments;
    private List<String> titles;

    public CourseBookingAdapter(FragmentManager fm,List<Fragment>fragments,List<String>titles) {
        super(fm);
        this.fragments = fragments;
        this.titles = titles;
    }

    @Override
    public Fragment getItem(int position) {
        return fragments == null ? null : fragments.get(position);
    }
    @Override
    public int getCount() {
        return titles == null ? 0 : titles.size();

    }
    @Override
    public CharSequence getPageTitle(int position) {
        return titles == null ? null : titles.get(position);
    }

}
